package cn.wusifx.zabbix.request.builder.correlation;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.List;
import java.util.Map;

/***
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/correlation/create
 */
public class CorrelationCreateRequestBuilder extends CreateRequestBuilder {
    private String name;
    private List<Map<String,Object>> operations;
    private Map<String,Object> filter;

    public CorrelationCreateRequestBuilder(String auth) {
        super("correlation.create", auth);
    }

    public CorrelationCreateRequestBuilder(Long id, String auth) {
        super("correlation.create", id, auth);
    }

    public String getName() {
        return name;
    }

    public CorrelationCreateRequestBuilder setName(String name) {
        this.name = name;
        return this;
    }

    public List<Map<String, Object>> getOperations() {
        return operations;
    }

    public CorrelationCreateRequestBuilder setOperations(List<Map<String, Object>> operations) {
        this.operations = operations;
        return this;
    }

    public Map<String, Object> getFilter() {
        return filter;
    }

    public CorrelationCreateRequestBuilder setFilter(Map<String, Object> filter) {
        this.filter = filter;
        return this;
    }


    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("name",name);
        baseRequest.getParams().put("operations",operations);
        baseRequest.getParams().put("filter",filter);
        return baseRequest;
    }
}
